home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / tvcolor.exe / TDEMO.HPP < prev   
C/C++ Source or Header  |  1992-06-27  |  3KB  |  73 lines

  1. /*-----------------------------------------------------------------------*/
  2. /* filename -       tdemo.hpp                                            */
  3. /*                                                                       */
  4. /* function(s)                                                           */
  5. /*                  declarations for the TDemo class                     */
  6. /*                                                                       */
  7. /*-----------------------------------------------------------------------*/
  8.  
  9. /*-----------------------------------------------------------------------*/
  10. /*                                                                       */
  11. /*    TDEMO.HPP                                                          */
  12. /*                                                                       */
  13. /*    Copyright (C) 1992 Michael Newton and Comsoft Software             */
  14. /*    All Rights Reserved.                                               */
  15. /*                                                                       */
  16. /*-----------------------------------------------------------------------*/
  17.  
  18. #if !defined __TDEMO_HPP
  19.  
  20. #define __TDEMO_HPP
  21.  
  22. class far TApplication;
  23. class far TEvent;
  24. class far TMenubar;
  25. class far TPalette;
  26. class far TRect;
  27. class far TStatusLine;
  28. class far TStaticText;
  29. class far TView;
  30.  
  31. // Event commands
  32. const ushort cmAbout   = 5000,
  33.              cmColors  = 5001,
  34.              cmSavPal  = 5002,
  35.              cmNone    = 0;
  36.  
  37. // Key codes
  38. const ushort kbNone    = kbNoKey;
  39.  
  40. // Help contexts
  41. const ushort hcColors  = 5000,
  42.              hcNone    = hcNoContext;
  43.  
  44.  
  45. class TDemo : public TApplication
  46. {
  47.    public:
  48.       TDemo();
  49.       virtual ~TDemo();
  50.       static TStatusLine *initStatusLine(TRect);
  51.       static TMenuBar *initMenuBar(TRect);
  52.       virtual void handleEvent(TEvent& Event);
  53.    private:
  54.       static const char * near configFile; // Configuration filename
  55.       char currentPattern;                 // Current pattern character
  56.       ushort patternButtons;               // Pattern radiobuttons
  57.       Boolean saveDesk();                  // Save desktop
  58.       Boolean restoreDesk();               // Restore desktop
  59.       void about();                        // About box
  60.       void colors();                       // TVColorDialog box
  61.       void storeDesk(fpstream& strm);      // Write desktop to stream
  62.       void loadDesk(fpstream& strm);       // Read desktop from stream
  63.       void writePalette(const char *path); // Save current palette
  64. };
  65.  
  66. static void writeView(TView *v, void *strm);
  67. static void closeView(TView *v, void *p);
  68. ushort execDialog(TDialog *d, void *data);
  69. Boolean confirmExit();
  70.  
  71. #endif                            // End of __TDEMO_HPP
  72.  
  73.